<?php
$language = $this->session->userdata('ua_language');
//$this->firephp->log($language);
$this->lang->load('listings', $language);
?>

&laquo; <?php
$back = $this->lang->line('listings_back_to_categories');
echo anchor('', $back)?>
<div id="listings">


    <h1><?php //echo $this->lang->line('listings_of_category');?>
        <span>
            <?php
          //  echo $this->session->userdata('ua_language')== 'greek' ? $category->name_gr : $category->name;
            ?>
        </span>
    </h1>
    <?php if (!empty($last_week)) {
        echo '<h2>'.$this->lang->line('listings_last_week').'</h2>';
        foreach($last_week['entries'] as $row => $entry): ?>
    <dl class="listing">
        <dt><?=anchor('listings/details/'.$entry->entry_id, $entry->title.' ('.mysqldatetime_to_date($entry->date_added,"d/m/y").')', array('title' => $this->lang->line('view_details_of').$entry->title))?></dt>
        <dd><?=character_limiter($entry->e_description, 200)?></dd>
        <dd>
            <ul class="links clearfix">

                <li><?=anchor('listings/details/'.$entry->entry_id, $this->lang->line('details'), array('title' => $this->lang->line('view_details_of').$entry->title, 'class' => 'detail'))?></li>
            </ul>
        </dd>
    </dl>
        <?php endforeach;
    }?>


    <?php if (!empty($before_last_week)) {
        echo '<h2>'.$this->lang->line('listings_before_last_week').'</h2>';

        foreach($before_last_week['entries'] as $row => $entry): ?>
    <dl class="listing">
        <dt><?=anchor('listings/details/'.$entry->entry_id, $entry->title, array('title' => 'View details of '.$entry->title))?></dt>
        <dd><?=character_limiter($entry->e_description, 200)?></dd>
        <dd>
            <ul class="links clearfix">

                <li><?=anchor('listings/details/'.$entry->entry_id, 'details', array('title' => 'View details of '.$entry->title, 'class' => 'detail'))?></li>
            </ul>
        </dd>
    </dl>
        <?php endforeach;
    }?>

    <div class="clearfix">
        <?=$pagination?>
    </div>   
</div>
<?php 
$add = $this->lang->line('add_a_new_listing');
echo anchor('member/listings/add', $add, array('class' => 'bigbutton_'.$language.' add_link_'.$language));


$this->firephp->log($language);